///@file Material.cpp
///@brief Implementation of the class representing a material
///@author Arnaud Duval
///@version 0.0
///@date 2010/02/26


#include "Material.h"

///@brief Default constructor
Material::Material()
{

}

///@brief Destructor
Material::~Material()
{

}

///@brief Set the value of a given parameter
///@param idx index of parameter to set
///@param value new value for parameter
void Material::SetParameter(int idx, double value)
{

}

///@brief Compute stess tensor increment from strain tensor tensor increment and initial stress and strain
///@param Eini Strain tensor at the beginning of increment
///@param Sini Stress tensor at the beginning of increment
///@param DE Strain increment
StressTensor Material::Dstress(StrainTensor Eini, StressTensor Sini, StrainTensor DE)
{
	StressTensor res;
	return res;
}

///@brief Print output
///@param s out stream
void Material::PrintOutput(std::ostream &s)
{
	s << "Default method\n";
}

///@brief Set reference value
///@param s value of reference
void Material::SetReference(std::string s)
{
	reference = s;
}

///@brief Return value of reference
std::string Material::Reference()
{
	return reference;
}

///@brief Similar to an Abaqus UMAT
///@warning The name of this function should be changed
///@return true if convergence is OK
///@param strain Strain at the beginning of increment
///@param dstrain Increment of strain
///@param stress Stress at the beginning of increment. Should be updated
///@param ddsdde Tangent operator at the end of increment
bool Material::UMAT(const Vector& strain, const Vector& dstrain, Vector& stress, Matrix& ddsdde)
{
    std::cout << "UMAT Material\n";
    return true;
}

///@brief Overload of << operator
///@param s out stream
///@param m Material object to put in the out stream
std::ostream& operator << (std::ostream& s, Material& m)
{
	m.PrintOutput(s);
	return s;
}